Recipients Property (MessageFilter Object) 

The Recipients property sets filtering on whether a message s recipients include a particular Recipient_SDVUS object. Read/write.

Syntax

Set objOneRecip = objMessageFilter.Recipients(index)

objOneRecip

Object. A single Recipient object.

objMessageFilter

Object. This MessageFilter object.

index

Long. Specifies the number of the recipient within the Recipients collection. Ranges from 1 to the value specified by the Recipients collection s CountADGKMT property.

 

Data Type

Object

Remarks

Although the Recipients property nominally deals with a Recipients collection, only the first member participates in message filtering. You should not maintain more than one Recipient object in the collection.

The Recipients property specifies that the message filter should pass only messages with a recipient corresponding to the Recipients property. The comparison uses the Name2K9E3V. property of both Recipient objects. The filter passes the message if the Name property of any of its recipients contains the filter recipient s Name property as a substring.

Example

This example copies the first valid recipient from an original message to a message filter in order to restrict the Messages collection to messages containing that recipient:

Dim objOneRecip as Object

' assume objMessage and objMessageFilter are valid

objMessageFilter.Recipients.Delete ' remove any filter recipients

For I

    strRecipName = objMessage.Recipients.Item(1).Name

    If strRecipName <> "" Then

        Set objOneRecip = objMessageFilter.Recipients.Add

        If objOneRecip Is Nothing Then

            MsgBox "unable to create recipient in message filter"

            Exit Function

        End If

        objOneRecip.Name = strRecipName

        objOneRecip.Address = objMessage.Recipients.Item(i).Address

        objOneRecip.Type = objMessage.Recipients.Item(i).Type

    End If

Next i